﻿@using PagedList
@using PagedList.Mvc
@model IPagedList<KhatVongViet.Models.Article>
@{
    ViewBag.Title = "Khát Vọng Việt - Hoạt Động Sắp Diễn Ra";
}

<div class="div-title">
    <div class="div-title-text">
        Chi tiết tin tức mới / Trang @ViewBag.Page
    </div>
</div>
<div class="div-title-end">
    <div class="div-title-end-peace">
        <img src="../../Content/images/top-title-image.png" />
    </div>
    <div class="div-title-end-peace">
        <img src="../../Content/images/bot-title-image.png" />
    </div>
</div>
<br />
<br />
<br />
@for (int i = ViewBag.NumberItemPerPage * ViewBag.Page - ViewBag.NumberItemPerPage; i < ViewBag.NumberArticle && i < ViewBag.NumberItemPerPage * ViewBag.Page; i++)
{
    <div class="box-confession-alldetail-peaces">
        <div class="box-image-cxv">
            <img src=@ViewBag.listAllCamXucViet[i].Image />
        </div>
        <div class="box-camxucviet-title">
            <a class="titlelink" href="/Home/DetailArticle?idArticle=@ViewBag.listAllCamXucViet[i].ID">
                @if (ViewBag.listAllCamXucViet[i].Title.Length <= 50)
                {
                    @ViewBag.listAllCamXucViet[i].Title;
                }
                else
                {
                    <p>@ViewBag.listAllCamXucViet[i].Title.Substring(0, ViewBag.listAllCamXucViet[i].Title.Substring(0, 50).LastIndexOf(" ")) ...</p>;
                }
            </a>
        </div>
        <div class="box-camxucviet-email">
            @if (ViewBag.listAllCamXucViet[i].DateCreate != null)
            { 
                <p>Ngày tạo: @ViewBag.listAllCamXucViet[i].DateCreate</p>
            }
            else
            {
                <p>Ngày tạo :</p>
            }
        </div>
        <div class="box-camxucviet-detail">
            @if (ViewBag.listAllCamXucViet[i].Summary != null)
            {
                if (ViewBag.listAllCamXucViet[i].Summary.Length <= 300)
                {
                @ViewBag.listAllCamXucViet[i].Summary
                }
                else
                {
                @ViewBag.listAllCamXucViet[i].Summary.Substring(0, ViewBag.listAllCamXucViet[i].Summary.Substring(0, 300).LastIndexOf(" "))
                }
            }
        </div>
    </div>
}
<div class="PagedList">
        @Html.PagedListPager(Model, page => Url.Action("AllDetailActivities", "Home", new { page }), PagedListRenderOptions.OnlyShowFivePagesAtATime)
</div>
